<?php

namespace Fize\Third\WechatWork\Qyapi;

use Fize\Third\WechatWork\QyapiAbstract;

/**
 * 批量处理
 */
class Batch extends QyapiAbstract
{

    /**
     * 将代开发应用或第三方应用获取的密文open_userid转换为明文userid
     * @param array $open_userid_list open_userid列表，最多不超过1000个。必须是source_agentid对应的应用所获取
     * @param int   $source_agentid   企业授权的代开发自建应用或第三方应用的agentid
     * @return array
     */
    public function openuseridToUserid(array $open_userid_list, int $source_agentid): array
    {
        $params = [
            'open_userid_list' => $open_userid_list,
            'source_agentid'   => $source_agentid
        ];
        return $this->httpPost("/batch/openuserid_to_userid?access_token={$this->accessToken}", $params);
    }
}